package com.demonzym.data.trans;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;

import com.demonzym.framework.string.MyString;

public class SendPacket implements Serializable, Cloneable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public String cmd;
	public String data;
	
	private String content;

	public SendPacket(String c) {
		cmd = c;
		content = c;
	}

	public void writeUTF(String s) {
		data = s;
		content += data;
	}
	
	public String getCMD(){
		return cmd;
	}

	public byte[] getData() {
		if(!MyString.isStringEmpty(content)){
			return content.getBytes();
		} else {
			return null;
		}
	}

}
